﻿@using ThuySan.Areas.Backend.Models
@using ThuySan.Models
@model ThuySan.Models.TagModel
@{
    Layout = "~/Areas/Backend/Views/Shared/_Layout.cshtml";

    Header header = new Header {
                                       Common = "ViewUserControl_Tag_Edit",
                                       CurentCommon = "Tag",
                                       PageHeader = "Edit Tag",
                                       Menulv1 = "01",
                                       Menulv2 = "0104"
                               };
    ViewData[Header.Key] = header;
    ViewBag.Title = "Edit Tag - Admin Control Panel";
    Html.EnableClientValidation();
}
<div class="content-box">
    <div class="content-box-header">
        <h3>
            Edit Tag</h3>
    </div>
    <div class="content-box-content">
        @using (Html.BeginForm("Edit", "Tag", FormMethod.Post, new {
                                                                           enctype = "multipart/form-data"
                                                                   }))
        {
            @Html.HiddenFor(c => c.TagId)
            @Html.ValidationMessage("error")
            <div class="input-item">
                <label>
                    Name</label>
                @Html.TextBoxFor(c => c.Name, new {
                                                          @class = "text-input medium-input"
                                                  })
                @Html.ValidationMessageFor(c => c.Name)
            </div>
            <div class="input-item">
                <label>
                    Description</label>
                @Html.TextAreaFor(c => c.Description, new {
                                                                  @class = "text-input large-input"
                                                          })
                @Html.ValidationMessageFor(c => c.Description)
            </div>
            <div class="input-item">
                <label>
                    Detail</label>
                @{
                    Html.Telerik().Editor().Name("Detail").Encode(false).HtmlAttributes(new {
                                                                                                    style = "height:400px"
                                                                                            }).Value(Model.Detail).Render();
                }
            </div>
            <div class="input-item">
                <label>
                    Image</label>
                @if (!string.IsNullOrEmpty(Model.Avatar))
                {
                    <img src="@Html.UploadPath("Tag")@Model.Avatar" width="200" />
                    <br />
                }
                <input type="file" name="thumbnail" id="thumbnail" />
                @Html.ValidationMessageFor(c => c.Avatar)
            </div>
           <div class="input-item">
                <label>
                    Is Static Content</label>
                @Html.CheckBoxFor(c => c.IsStaticContent)
                @Html.ValidationMessageFor(c => c.IsStaticContent)
            </div>
            <div class="input-item">
                <label>
                    Is Top Menu</label>
                @Html.CheckBoxFor(c => c.IsTopMenu)
                @Html.ValidationMessageFor(c => c.IsTopMenu)
            </div>
            <div class="input-item">
                <label>
                    Is Left Column</label>
                @Html.CheckBoxFor(c => c.IsLeftColumn)
                @Html.ValidationMessageFor(c => c.IsLeftColumn)
            </div>
            <div class="input-item">
                <label>
                    Is Right Column</label>
                @Html.CheckBoxFor(c => c.IsRightColumn)
                @Html.ValidationMessageFor(c => c.IsRightColumn)
            </div>
             <div class="input-item">
                <label>
                    Is Footer</label>
                @Html.CheckBoxFor(c => c.IsFooter)
                @Html.ValidationMessageFor(c => c.IsFooter)
            </div>            
            <div class="title-seperator">
                Page Information</div>
            <div class="seperator">
            </div>
            <div class="input-item">
                <label>
                    Url</label>
                @Html.TextBoxFor(c => c.PageUrl, new
           {
               @class = "text-input medium-input"
           })
                @Html.ValidationMessageFor(c => c.PageUrl)
            </div>
            <input type="submit" value="Update" class="button" />
            <input type="button" onclick="javascript:window.location.href='@Url.Action("Index")';" value="Reset" class="button" />
        }
    </div>
</div>